home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / wfc007.000 / src / lmerr.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-22  |  37.8 KB  |  1,423 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like.
  10. */
  11.  
  12. #if defined( _DEBUG )
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. void Convert_NERR_Code_to_String( DWORD error_code, CString& error_message )
  18. {
  19.    switch( error_code )
  20.    {
  21.       case NERR_Success:
  22.  
  23.          error_message = "Success.";
  24.          return;
  25.  
  26.       case NERR_NetNotStarted:
  27.    
  28.          error_message = "The workstation driver is not installed.";
  29.          return;
  30.  
  31.       case NERR_UnknownServer:
  32.    
  33.          error_message = "The server could not be located.";
  34.          return;
  35.  
  36.       case NERR_ShareMem:
  37.    
  38.          error_message = "An internal error occurred. The network cannot access a shared memory segment.";
  39.          return;
  40.  
  41.       case NERR_NoNetworkResource:
  42.    
  43.          error_message = "A network resource shortage occurred.";
  44.          return;
  45.  
  46.       case NERR_RemoteOnly:
  47.    
  48.          error_message = "This operation is not supported on workstations.";
  49.          return;
  50.  
  51.       case NERR_DevNotRedirected:
  52.    
  53.          error_message = "The device is not connected.";
  54.          return;
  55.  
  56.       case NERR_ServerNotStarted:
  57.    
  58.          error_message = "The Server service is not started.";
  59.          return;
  60.  
  61.       case NERR_ItemNotFound:
  62.    
  63.          error_message = "The queue is empty.";
  64.          return;
  65.  
  66.       case NERR_UnknownDevDir:
  67.    
  68.          error_message = "The device or directory does not exist.";
  69.          return;
  70.  
  71.       case NERR_RedirectedPath:
  72.    
  73.          error_message = "The operation is invalid on a redirected resource.";
  74.          return;
  75.  
  76.       case NERR_DuplicateShare:
  77.    
  78.          error_message = "The name has already been shared.";
  79.          return;
  80.  
  81.       case NERR_NoRoom:
  82.    
  83.          error_message = "The server is currently out of the requested resource.";
  84.          return;
  85.  
  86.       case NERR_TooManyItems:
  87.    
  88.          error_message = "Requested addition of items exceeds the maximum allowed.";
  89.          return;
  90.  
  91.       case NERR_InvalidMaxUsers:
  92.    
  93.          error_message = "The Peer service supports only two simultaneous users.";
  94.          return;
  95.  
  96.       case NERR_BufTooSmall:
  97.    
  98.          error_message = "The API return buffer is too small.";
  99.          return;
  100.  
  101.       case NERR_RemoteErr:
  102.    
  103.          error_message = "A remote API error occurred.";
  104.          return;
  105.  
  106.       case NERR_LanmanIniError:
  107.    
  108.          error_message = "An error occurred when opening or reading the configuration file.";
  109.          return;
  110.  
  111.       case NERR_NetworkError:
  112.    
  113.          error_message = "A general network error occurred.";
  114.          return;
  115.  
  116.       case NERR_WkstaInconsistentState:
  117.    
  118.          error_message = "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
  119.          return;
  120.  
  121.       case NERR_WkstaNotStarted:
  122.    
  123.          error_message = "The Workstation service has not been started.";
  124.          return;
  125.  
  126.       case NERR_BrowserNotStarted:
  127.    
  128.          error_message = "The requested information is not available.";
  129.          return;
  130.  
  131.       case NERR_InternalError:
  132.    
  133.          error_message = "An internal Windows NT error occurred.";
  134.          return;
  135.  
  136.       case NERR_BadTransactConfig:
  137.    
  138.          error_message = "The server is not configured for transactions.";
  139.          return;
  140.  
  141.       case NERR_InvalidAPI:
  142.    
  143.          error_message = "The requested API is not supported on the remote server.";
  144.          return;
  145.  
  146.       case NERR_BadEventName:
  147.    
  148.          error_message = "The event name is invalid.";
  149.          return;
  150.  
  151.       case NERR_DupNameReboot:
  152.    
  153.          error_message = "The computer name already exists on the network. Change it and restart the computer.";
  154.          return;
  155.  
  156.       case NERR_CfgCompNotFound:
  157.    
  158.          error_message = "The specified component could not be found in the configuration information.";
  159.          return;
  160.  
  161.       case NERR_CfgParamNotFound:
  162.    
  163.          error_message = "The specified parameter could not be found in the configuration information.";
  164.          return;
  165.  
  166.       case NERR_LineTooLong:
  167.    
  168.          error_message = "A line in the configuration file is too long.";
  169.          return;
  170.  
  171.       case NERR_QNotFound:
  172.    
  173.          error_message = "The printer does not exist.";
  174.          return;
  175.  
  176.       case NERR_JobNotFound:
  177.    
  178.          error_message = "The print job does not exist.";
  179.          return;
  180.  
  181.       case NERR_DestNotFound:
  182.    
  183.          error_message = "The printer destination cannot be found.";
  184.          return;
  185.  
  186.       case NERR_DestExists:
  187.    
  188.          error_message = "The printer destination already exists.";
  189.          return;
  190.  
  191.       case NERR_QExists:
  192.    
  193.          error_message = "The printer queue already exists.";
  194.          return;
  195.  
  196.       case NERR_QNoRoom:
  197.    
  198.          error_message = "No more printers can be added.";
  199.          return;
  200.  
  201.       case NERR_JobNoRoom:
  202.    
  203.          error_message = "No more print jobs can be added.";
  204.          return;
  205.  
  206.       case NERR_DestNoRoom:
  207.    
  208.          error_message = "No more printer destinations can be added.";
  209.          return;
  210.  
  211.       case NERR_DestIdle:
  212.    
  213.          error_message = "This printer destination is idle and cannot accept control operations.";
  214.          return;
  215.  
  216.       case NERR_DestInvalidOp:
  217.    
  218.          error_message = "This printer destination request contains an invalid control function.";
  219.          return;
  220.  
  221.       case NERR_ProcNoRespond:
  222.    
  223.          error_message = "The print processor is not responding.";
  224.          return;
  225.  
  226.       case NERR_SpoolerNotLoaded:
  227.    
  228.          error_message = "The spooler is not running.";
  229.          return;
  230.  
  231.       case NERR_DestInvalidState:
  232.    
  233.          error_message = "This operation cannot be performed on the print destination in its current state.";
  234.          return;
  235.  
  236.       case NERR_QInvalidState:
  237.    
  238.          error_message = "This operation cannot be performed on the printer queue in its current state.";
  239.          return;
  240.  
  241.       case NERR_JobInvalidState:
  242.    
  243.          error_message = "This operation cannot be performed on the print job in its current state.";
  244.          return;
  245.  
  246.       case NERR_SpoolNoMemory:
  247.    
  248.          error_message = "A spooler memory allocation failure occurred.";
  249.          return;
  250.  
  251.       case NERR_DriverNotFound:
  252.    
  253.          error_message = "The device driver does not exist.";
  254.          return;
  255.  
  256.       case NERR_DataTypeInvalid:
  257.    
  258.          error_message = "The data type is not supported by the print processor.";
  259.          return;
  260.  
  261.       case NERR_ProcNotFound:
  262.    
  263.          error_message = "The print processor is not installed.";
  264.          return;
  265.  
  266.       case NERR_ServiceTableLocked:
  267.    
  268.          error_message = "The service database is locked.";
  269.          return;
  270.  
  271.       case NERR_ServiceTableFull:
  272.    
  273.          error_message = "The service table is full.";
  274.          return;
  275.  
  276.       case NERR_ServiceInstalled:
  277.    
  278.          error_message = "The requested service has already been started.";
  279.          return;
  280.  
  281.       case NERR_ServiceEntryLocked:
  282.    
  283.          error_message = "The service does not respond to control actions.";
  284.          return;
  285.  
  286.       case NERR_ServiceNotInstalled:
  287.    
  288.          error_message = "The service has not been started.";
  289.          return;
  290.  
  291.       case NERR_BadServiceName:
  292.    
  293.          error_message = "The service name is invalid.";
  294.          return;
  295.  
  296.       case NERR_ServiceCtlTimeout:
  297.    
  298.          error_message = "The service is not responding to the control function.";
  299.          return;
  300.  
  301.       case NERR_ServiceCtlBusy:
  302.    
  303.          error_message = "The service control is busy.";
  304.          return;
  305.  
  306.       case NERR_BadServiceProgName:
  307.    
  308.          error_message = "The configuration file contains an invalid service program name.";
  309.          return;
  310.  
  311.       case NERR_ServiceNotCtrl:
  312.    
  313.          error_message = "The service could not be controlled in its present state.";
  314.          return;
  315.  
  316.       case NERR_ServiceKillProc:
  317.    
  318.          error_message = "The service ended abnormally.";
  319.          return;
  320.  
  321.       case NERR_ServiceCtlNotValid:
  322.    
  323.          error_message = "The requested pause or stop is not valid for this service.";
  324.          return;
  325.  
  326.       case NERR_NotInDispatchTbl:
  327.    
  328.          error_message = "The service control dispatcher could not find the service name in the dispatch table.";
  329.          return;
  330.  
  331.       case NERR_BadControlRecv:
  332.    
  333.          error_message = "The service control dispatcher pipe read failed.";
  334.          return;
  335.  
  336.       case NERR_ServiceNotStarting:
  337.    
  338.          error_message = "A thread for the new service could not be created.";
  339.          return;
  340.  
  341.       case NERR_AlreadyLoggedOn:
  342.    
  343.          error_message = "This workstation is already logged on to the local-area network.";
  344.          return;
  345.  
  346.       case NERR_NotLoggedOn:
  347.    
  348.          error_message = "The workstation is not logged on to the local-area network.";
  349.          return;
  350.  
  351.       case NERR_BadUsername:
  352.    
  353.          error_message = "The user name or group name parameter is invalid.";
  354.          return;
  355.  
  356.       case NERR_BadPassword:
  357.    
  358.          error_message = "The password parameter is invalid.";
  359.          return;
  360.  
  361.       case NERR_UnableToAddName_W:
  362.    
  363.          error_message = "@W The logon processor did not add the message alias.";
  364.          return;
  365.  
  366.       case NERR_UnableToAddName_F:
  367.    
  368.          error_message = "The logon processor did not add the message alias.";
  369.          return;
  370.  
  371.       case NERR_UnableToDelName_W:
  372.    
  373.          error_message = "@W The logoff processor did not delete the message alias.";
  374.          return;
  375.  
  376.       case NERR_UnableToDelName_F:
  377.    
  378.          error_message = "The logoff processor did not delete the message alias.";
  379.          return;
  380.  
  381.       case NERR_LogonsPaused:
  382.    
  383.          error_message = "Network logons are paused.";
  384.          return;
  385.  
  386.       case NERR_LogonServerConflict:
  387.    
  388.          error_message = "A centralized logon-server conflict occurred.";
  389.          return;
  390.  
  391.       case NERR_LogonNoUserPath:
  392.    
  393.          error_message = "The server is configured without a valid user path.";
  394.          return;
  395.  
  396.       case NERR_LogonScriptError:
  397.    
  398.          error_message = "An error occurred while loading or running the logon script.";
  399.          return;
  400.  
  401.       case NERR_StandaloneLogon:
  402.    
  403.          error_message = "The logon server was not specified. Your computer will be logged on as STANDALONE.";
  404.          return;
  405.  
  406.       case NERR_LogonServerNotFound:
  407.    
  408.          error_message = "The logon server could not be found.";
  409.          return;
  410.  
  411.       case NERR_LogonDomainExists:
  412.    
  413.          error_message = "There is already a logon domain for this computer.";
  414.          return;
  415.  
  416.       case NERR_NonValidatedLogon:
  417.    
  418.          error_message = "The logon server could not validate the logon.";
  419.          return;
  420.  
  421.       case NERR_ACFNotFound:
  422.    
  423.          error_message = "The security database could not be found.";
  424.          return;
  425.  
  426.       case NERR_GroupNotFound:
  427.    
  428.          error_message = "The group name could not be found.";
  429.          return;
  430.  
  431.       case NERR_UserNotFound:
  432.    
  433.          error_message = "The user name could not be found.";
  434.          return;
  435.  
  436.       case NERR_ResourceNotFound:
  437.    
  438.          error_message = "The resource name could not be found.";
  439.          return;
  440.  
  441.       case NERR_GroupExists:
  442.    
  443.          error_message = "The group already exists.";
  444.          return;
  445.  
  446.       case NERR_UserExists:
  447.    
  448.          error_message = "The user account already exists.";
  449.          return;
  450.  
  451.       case NERR_ResourceExists:
  452.    
  453.          error_message = "The resource permission list already exists.";
  454.          return;
  455.  
  456.       case NERR_NotPrimary:
  457.    
  458.          error_message = "This operation is only allowed on the primary domain controller of the domain.";
  459.          return;
  460.  
  461.       case NERR_ACFNotLoaded:
  462.    
  463.          error_message = "The security database has not been started.";
  464.          return;
  465.  
  466.       case NERR_ACFNoRoom:
  467.    
  468.          error_message = "There are too many names in the user accounts database.";
  469.          return;
  470.  
  471.       case NERR_ACFFileIOFail:
  472.    
  473.          error_message = "A disk I/O failure occurred.";
  474.          return;
  475.  
  476.       case NERR_ACFTooManyLists:
  477.    
  478.          error_message = "The limit of 64 entries per resource was exceeded.";
  479.          return;
  480.  
  481.       case NERR_UserLogon:
  482.    
  483.          error_message = "Deleting a user with a session is not allowed.";
  484.          return;
  485.  
  486.       case NERR_ACFNoParent:
  487.    
  488.          error_message = "The parent directory could not be located.";
  489.          return;
  490.  
  491.       case NERR_CanNotGrowSegment:
  492.    
  493.          error_message = "Unable to add to the security database session cache segment.";
  494.          return;
  495.  
  496.       case NERR_SpeGroupOp:
  497.    
  498.          error_message = "This operation is not allowed on this special group.";
  499.          return;
  500.  
  501.       case NERR_NotInCache:
  502.    
  503.          error_message = "This user is not cached in user accounts database session cache.";
  504.          return;
  505.  
  506.       case NERR_UserInGroup:
  507.    
  508.          error_message = "The user already belongs to this group.";
  509.          return;
  510.  
  511.       case NERR_UserNotInGroup:
  512.    
  513.          error_message = "The user does not belong to this group.";
  514.          return;
  515.  
  516.       case NERR_AccountUndefined:
  517.    
  518.          error_message = "This user account is undefined.";
  519.          return;
  520.  
  521.       case NERR_AccountExpired:
  522.    
  523.          error_message = "This user account has expired.";
  524.          return;
  525.  
  526.       case NERR_InvalidWorkstation:
  527.    
  528.          error_message = "The user is not allowed to log on from this workstation.";
  529.          return;
  530.  
  531.       case NERR_InvalidLogonHours:
  532.    
  533.          error_message = "The user is not allowed to log on at this time.";
  534.          return;
  535.  
  536.       case NERR_PasswordExpired:
  537.    
  538.          error_message = "The password of this user has expired.";
  539.          return;
  540.  
  541.       case NERR_PasswordCantChange:
  542.    
  543.          error_message = "The password of this user cannot change.";
  544.          return;
  545.  
  546.       case NERR_PasswordHistConflict:
  547.    
  548.          error_message = "This password cannot be used now.";
  549.          return;
  550.  
  551.       case NERR_PasswordTooShort:
  552.    
  553.          error_message = "The password is shorter than required.";
  554.          return;
  555.  
  556.       case NERR_PasswordTooRecent:
  557.    
  558.          error_message = "The password of this user is too recent to change.";
  559.          return;
  560.  
  561.       case NERR_InvalidDatabase:
  562.    
  563.          error_message = "The security database is corrupted.";
  564.          return;
  565.  
  566.       case NERR_DatabaseUpToDate:
  567.    
  568.          error_message = "No updates are necessary to this replicant network/local security database.";
  569.          return;
  570.  
  571.       case NERR_SyncRequired:
  572.    
  573.          error_message = "This replicant database is outdated; synchronization is required.";
  574.          return;
  575.  
  576.       case NERR_UseNotFound:
  577.    
  578.          error_message = "The network connection could not be found.";
  579.          return;
  580.  
  581.       case NERR_BadAsgType:
  582.    
  583.          error_message = "This asg_type is invalid.";
  584.          return;
  585.  
  586.       case NERR_DeviceIsShared:
  587.    
  588.          error_message = "This device is currently being shared.";
  589.          return;
  590.  
  591.       case NERR_NoComputerName:
  592.    
  593.          error_message = "The computer name could not be added as a message alias. The name may already exist on the network.";
  594.          return;
  595.  
  596.       case NERR_MsgAlreadyStarted:
  597.    
  598.          error_message = "The Messenger service is already started.";
  599.          return;
  600.  
  601.       case NERR_MsgInitFailed:
  602.    
  603.          error_message = "The Messenger service failed to start.";
  604.          return;
  605.  
  606.       case NERR_NameNotFound:
  607.    
  608.          error_message = "The message alias could not be found on the network.";
  609.          return;
  610.  
  611.       case NERR_AlreadyForwarded:
  612.    
  613.          error_message = "This message alias has already been forwarded.";
  614.          return;
  615.  
  616.       case NERR_AddForwarded:
  617.    
  618.          error_message = "This message alias has been added but is still forwarded.";
  619.          return;
  620.  
  621.       case NERR_AlreadyExists:
  622.    
  623.          error_message = "This message alias already exists locally.";
  624.          return;
  625.  
  626.       case NERR_TooManyNames:
  627.    
  628.          error_message = "The maximum number of added message aliases has been exceeded.";
  629.          return;
  630.  
  631.       case NERR_DelComputerName:
  632.    
  633.          error_message = "The computer name could not be deleted.";
  634.          return;
  635.  
  636.       case NERR_LocalForward:
  637.    
  638.          error_message = "Messages cannot be forwarded back to the same workstation.";
  639.          return;
  640.  
  641.       case NERR_GrpMsgProcessor:
  642.    
  643.          error_message = "An error occurred in the domain message processor.";
  644.          return;
  645.  
  646.       case NERR_PausedRemote:
  647.    
  648.          error_message = "The message was sent, but the recipient has paused the Messenger service.";
  649.          return;
  650.  
  651.       case NERR_BadReceive:
  652.    
  653.          error_message = "The message was sent but not received.";
  654.          return;
  655.  
  656.       case NERR_NameInUse:
  657.    
  658.          error_message = "The message alias is currently in use. Try again later.";
  659.          return;
  660.  
  661.       case NERR_MsgNotStarted:
  662.    
  663.          error_message = "The Messenger service has not been started.";
  664.          return;
  665.  
  666.       case NERR_NotLocalName:
  667.    
  668.          error_message = "The name is not on the local computer.";
  669.          return;
  670.  
  671.       case NERR_NoForwardName:
  672.    
  673.          error_message = "The forwarded message alias could not be found on the network.";
  674.          return;
  675.  
  676.       case NERR_RemoteFull:
  677.    
  678.          error_message = "The message alias table on the remote station is full.";
  679.          return;
  680.  
  681.       case NERR_NameNotForwarded:
  682.    
  683.          error_message = "Messages for this alias are not currently being forwarded.";
  684.          return;
  685.  
  686.       case NERR_TruncatedBroadcast:
  687.    
  688.          error_message = "The broadcast message was truncated.";
  689.          return;
  690.  
  691.       case NERR_InvalidDevice:
  692.    
  693.          error_message = "This is an invalid device name.";
  694.          return;
  695.  
  696.       case NERR_WriteFault:
  697.    
  698.          error_message = "A write fault occurred.";
  699.          return;
  700.  
  701.       case NERR_DuplicateName:
  702.    
  703.          error_message = "A duplicate message alias exists on the network.";
  704.          return;
  705.  
  706.       case NERR_DeleteLater:
  707.    
  708.          error_message = "@W This message alias will be deleted later.";
  709.          return;
  710.  
  711.       case NERR_IncompleteDel:
  712.    
  713.          error_message = "The message alias was not successfully deleted from all networks.";
  714.          return;
  715.  
  716.       case NERR_MultipleNets:
  717.    
  718.          error_message = "This operation is not supported on computers with multiple networks.";
  719.          return;
  720.  
  721.       case NERR_NetNameNotFound:
  722.    
  723.          error_message = "This shared resource does not exist.";
  724.          return;
  725.  
  726.       case NERR_DeviceNotShared:
  727.    
  728.          error_message = "This device is not shared.";
  729.          return;
  730.  
  731.       case NERR_ClientNameNotFound:
  732.    
  733.          error_message = "A session does not exist with that computer name.";
  734.          return;
  735.  
  736.       case NERR_FileIdNotFound:
  737.    
  738.          error_message = "There is not an open file with that identification number.";
  739.          return;
  740.  
  741.       case NERR_ExecFailure:
  742.    
  743.          error_message = "A failure occurred when executing a remote administration command.";
  744.          return;
  745.  
  746.       case NERR_TmpFile:
  747.    
  748.          error_message = "A failure occurred when opening a remote temporary file.";
  749.          return;
  750.  
  751.       case NERR_TooMuchData:
  752.    
  753.          error_message = "The data    returned from a remote administration command has been truncated to 64K.";
  754.          return;
  755.  
  756.       case NERR_DeviceShareConflict:
  757.    
  758.          error_message = "This device cannot be shared as both a spooled and a non-spooled resource.";
  759.          return;
  760.  
  761.       case NERR_BrowserTableIncomplete:
  762.    
  763.          error_message = "The information in the list of servers may be incorrect.";
  764.          return;
  765.  
  766.       case NERR_NotLocalDomain:
  767.    
  768.          error_message = "The computer is not active in this domain.";
  769.          return;
  770.  
  771.       case NERR_DevInvalidOpCode:
  772.    
  773.          error_message = "The operation is invalid for this device.";
  774.          return;
  775.  
  776.       case NERR_DevNotFound:
  777.    
  778.          error_message = "This device cannot be shared.";
  779.          return;
  780.  
  781.       case NERR_DevNotOpen:
  782.    
  783.          error_message = "This device was not open.";
  784.          return;
  785.  
  786.       case NERR_BadQueueDevString:
  787.    
  788.          error_message = "This device name list is invalid.";
  789.          return;
  790.  
  791.       case NERR_BadQueuePriority:
  792.    
  793.          error_message = "The queue priority is invalid.";
  794.          return;
  795.  
  796.       case NERR_NoCommDevs:
  797.    
  798.          error_message = "There are no shared communication devices.";
  799.          return;
  800.  
  801.       case NERR_QueueNotFound:
  802.    
  803.          error_message = "The queue you specified does not exist.";
  804.          return;
  805.  
  806.       case NERR_BadDevString:
  807.    
  808.          error_message = "This list of devices is invalid.";
  809.          return;
  810.  
  811.       case NERR_BadDev:
  812.    
  813.          error_message = "The requested device is invalid.";
  814.          return;
  815.  
  816.       case NERR_InUseBySpooler:
  817.    
  818.          error_message = "This device is already in use by the spooler.";
  819.          return;
  820.  
  821.       case NERR_CommDevInUse:
  822.    
  823.          error_message = "This device is already in use as a communication device.";
  824.          return;
  825.  
  826.       case NERR_InvalidComputer:
  827.    
  828.          error_message = "This computer name is invalid.";
  829.          return;
  830.  
  831.       case NERR_MaxLenExceeded:
  832.    
  833.          error_message = "The string and prefix specified are too long.";
  834.          return;
  835.  
  836.       case NERR_BadComponent:
  837.    
  838.          error_message = "This path component is invalid.";
  839.          return;
  840.  
  841.       case NERR_CantType:
  842.    
  843.          error_message = "Could not determine the type of input.";
  844.          return;
  845.  
  846.       case NERR_TooManyEntries:
  847.    
  848.          error_message = "The buffer for types is not big enough.";
  849.          return;
  850.  
  851.       case NERR_ProfileFileTooBig:
  852.    
  853.          error_message = "Profile files cannot exceed 64K.";
  854.          return;
  855.  
  856.       case NERR_ProfileOffset:
  857.    
  858.          error_message = "The start offset is out of range.";
  859.          return;
  860.  
  861.       case NERR_ProfileCleanup:
  862.    
  863.          error_message = "The system cannot delete current connections to network resources.";
  864.          return;
  865.  
  866.       case NERR_ProfileUnknownCmd:
  867.    
  868.          error_message = "The system was unable to parse the command line in this file.";
  869.          return;
  870.  
  871.       case NERR_ProfileLoadErr:
  872.    
  873.          error_message = "An error occurred while loading the profile file.";
  874.          return;
  875.  
  876.       case NERR_ProfileSaveErr:
  877.    
  878.          error_message = "@W Errors occurred while saving the profile file. The profile was partially saved.";
  879.          return;
  880.  
  881.       case NERR_LogOverflow:
  882.    
  883.          error_message = "Log file %1 is full.";
  884.          return;
  885.  
  886.       case NERR_LogFileChanged:
  887.    
  888.          error_message = "This log file has changed between reads.";
  889.          return;
  890.  
  891.       case NERR_LogFileCorrupt:
  892.    
  893.          error_message = "Log file %1 is corrupt.";
  894.          return;
  895.  
  896.       case NERR_SourceIsDir:
  897.    
  898.          error_message = "The source path cannot be a directory.";
  899.          return;
  900.  
  901.       case NERR_BadSource:
  902.    
  903.          error_message = "The source path is illegal.";
  904.          return;
  905.  
  906.       case NERR_BadDest:
  907.    
  908.          error_message = "The destination path is illegal.";
  909.          return;
  910.  
  911.       case NERR_DifferentServers:
  912.    
  913.          error_message = "The source and destination paths are on different servers.";
  914.          return;
  915.  
  916.       case NERR_RunSrvPaused:
  917.    
  918.          error_message = "The Run server you requested is paused.";
  919.          return;
  920.  
  921.       case NERR_ErrCommRunSrv:
  922.    
  923.          error_message = "An error occurred when communicating with a Run server.";
  924.          return;
  925.  
  926.       case NERR_ErrorExecingGhost:
  927.    
  928.          error_message = "An error occurred when starting a background process.";
  929.          return;
  930.  
  931.       case NERR_ShareNotFound:
  932.    
  933.          error_message = "The shared resource you are connected to could not be found.";
  934.          return;
  935.  
  936.       case NERR_InvalidLana:
  937.    
  938.          error_message = "The LAN adapter number is invalid.";
  939.          return;
  940.  
  941.       case NERR_OpenFiles:
  942.    
  943.          error_message = "There are open files on the connection.";
  944.          return;
  945.  
  946.       case NERR_ActiveConns:
  947.    
  948.          error_message = "Active connections still exist.";
  949.          return;
  950.  
  951.       case NERR_BadPasswordCore:
  952.    
  953.          error_message = "This share name or password is invalid.";
  954.          return;
  955.  
  956.       case NERR_DevInUse:
  957.    
  958.          error_message = "The device is being accessed by an active process.";
  959.          return;
  960.  
  961.       case NERR_LocalDrive:
  962.    
  963.          error_message = "The drive letter is in use locally.";
  964.          return;
  965.  
  966.       case NERR_AlertExists:
  967.    
  968.          error_message = "The specified client is already registered for the specified event.";
  969.          return;
  970.  
  971.       case NERR_TooManyAlerts:
  972.    
  973.          error_message = "The alert table is full.";
  974.          return;
  975.  
  976.       case NERR_NoSuchAlert:
  977.    
  978.          error_message = "An invalid or nonexistent alert name was raised.";
  979.          return;
  980.  
  981.       case NERR_BadRecipient:
  982.    
  983.          error_message = "The alert recipient is invalid.";
  984.          return;
  985.  
  986.       case NERR_AcctLimitExceeded:
  987.    
  988.          error_message = "A user's session with this server has been deleted because the user's logon hours are no longer valid.";
  989.          return;
  990.  
  991.       case NERR_InvalidLogSeek:
  992.    
  993.          error_message = "The log file does not contain the requested record number.";
  994.          return;
  995.  
  996.       case NERR_BadUasConfig:
  997.    
  998.          error_message = "The user accounts database is not configured correctly.";
  999.          return;
  1000.  
  1001.       case NERR_InvalidUASOp:
  1002.    
  1003.          error_message = "This operation is not permitted when the Netlogon service is running.";
  1004.          return;
  1005.  
  1006.       case NERR_LastAdmin:
  1007.    
  1008.          error_message = "This operation is not allowed on the last administrative account.";
  1009.          return;
  1010.  
  1011.       case NERR_DCNotFound:
  1012.    
  1013.          error_message = "Could not find domain controller for this domain.";
  1014.          return;
  1015.  
  1016.       case NERR_LogonTrackingError:
  1017.    
  1018.          error_message = "Could not set logon information for this user.";
  1019.          return;
  1020.  
  1021.       case NERR_NetlogonNotStarted:
  1022.    
  1023.          error_message = "The Netlogon service has not been started.";
  1024.          return;
  1025.  
  1026.       case NERR_CanNotGrowUASFile:
  1027.    
  1028.          error_message = "Unable to add to the user accounts database.";
  1029.          return;
  1030.  
  1031.       case NERR_TimeDiffAtDC:
  1032.    
  1033.          error_message = "This server's clock is not synchronized with the primary domain controller's clock.";
  1034.          return;
  1035.  
  1036.       case NERR_PasswordMismatch:
  1037.    
  1038.          error_message = "A password mismatch has been detected.";
  1039.          return;
  1040.  
  1041.       case NERR_NoSuchServer:
  1042.    
  1043.          error_message = "The server identification does not specify a valid server.";
  1044.          return;
  1045.  
  1046.       case NERR_NoSuchSession:
  1047.    
  1048.          error_message = "The session identification does not specify a valid session.";
  1049.          return;
  1050.  
  1051.       case NERR_NoSuchConnection:
  1052.    
  1053.          error_message = "The connection identification does not specify a valid connection.";
  1054.          return;
  1055.  
  1056.       case NERR_TooManyServers:
  1057.    
  1058.          error_message = "There is no space for another entry in the table of available servers.";
  1059.          return;
  1060.  
  1061.       case NERR_TooManySessions:
  1062.    
  1063.          error_message = "The server has reached the maximum number of sessions it supports.";
  1064.          return;
  1065.  
  1066.       case NERR_TooManyConnections:
  1067.    
  1068.          error_message = "The server has reached the maximum number of connections it supports.";
  1069.          return;
  1070.  
  1071.       case NERR_TooManyFiles:
  1072.    
  1073.          error_message = "The server cannot open more files because it has reached its maximum number.";
  1074.          return;
  1075.  
  1076.       case NERR_NoAlternateServers:
  1077.    
  1078.          error_message = "There are no alternate servers registered on this server.";
  1079.          return;
  1080.  
  1081.       case NERR_TryDownLevel:
  1082.    
  1083.          error_message = "Try down-level (remote admin protocol) version of API instead.";
  1084.          return;
  1085.  
  1086.       case NERR_UPSDriverNotStarted:
  1087.    
  1088.          error_message = "The UPS driver could not be accessed by the UPS service.";
  1089.          return;
  1090.  
  1091.       case NERR_UPSInvalidConfig:
  1092.    
  1093.          error_message = "The UPS service is not configured correctly.";
  1094.          return;
  1095.  
  1096.       case NERR_UPSInvalidCommPort:
  1097.    
  1098.          error_message = "The UPS service could not access the specified Comm Port.";
  1099.          return;
  1100.  
  1101.       case NERR_UPSSignalAsserted:
  1102.    
  1103.          error_message = "The UPS indicated a line fail or low battery situation. Service not started.";
  1104.          return;
  1105.  
  1106.       case NERR_UPSShutdownFailed:
  1107.    
  1108.          error_message = "The UPS service failed to perform a system shut down.";
  1109.          return;
  1110.  
  1111.       case NERR_BadDosRetCode:
  1112.    
  1113.          error_message = "The program below returned an MS-DOS error code:";
  1114.          return;
  1115.  
  1116.       case NERR_ProgNeedsExtraMem:
  1117.    
  1118.          error_message = "The program below needs more memory:";
  1119.          return;
  1120.  
  1121.       case NERR_BadDosFunction:
  1122.    
  1123.          error_message = "The program below called an unsupported MS-DOS function:";
  1124.          return;
  1125.  
  1126.       case NERR_RemoteBootFailed:
  1127.    
  1128.          error_message = "The workstation failed to boot.";
  1129.          return;
  1130.  
  1131.       case NERR_BadFileCheckSum:
  1132.    
  1133.          error_message = "The file below is corrupt.";
  1134.          return;
  1135.  
  1136.       case NERR_NoRplBootSystem:
  1137.    
  1138.          error_message = "No loader is specified in the boot-block definition file.";
  1139.          return;
  1140.  
  1141.       case NERR_RplLoadrNetBiosErr:
  1142.    
  1143.          error_message = "NetBIOS    returned an error: The NCB and SMB are dumped above.";
  1144.          return;
  1145.  
  1146.       case NERR_RplLoadrDiskErr:
  1147.    
  1148.          error_message = "A disk I/O error occurred.";
  1149.          return;
  1150.  
  1151.       case NERR_ImageParamErr:
  1152.    
  1153.          error_message = "Image parameter substitution failed.";
  1154.          return;
  1155.  
  1156.       case NERR_TooManyImageParams:
  1157.    
  1158.          error_message = "Too many image parameters cross disk sector boundaries.";
  1159.          return;
  1160.  
  1161.       case NERR_NonDosFloppyUsed:
  1162.    
  1163.          error_message = "The image was not generated from an MS-DOS diskette formatted with /S.";
  1164.          return;
  1165.  
  1166.       case NERR_RplBootRestart:
  1167.    
  1168.          error_message = "Remote boot will be restarted later.";
  1169.          return;
  1170.  
  1171.       case NERR_RplSrvrCallFailed:
  1172.    
  1173.          error_message = "The call to the Remoteboot server failed.";
  1174.          return;
  1175.  
  1176.       case NERR_CantConnectRplSrvr:
  1177.    
  1178.          error_message = "Cannot connect to the Remoteboot server.";
  1179.          return;
  1180.  
  1181.       case NERR_CantOpenImageFile:
  1182.    
  1183.          error_message = "Cannot open image file on the Remoteboot server.";
  1184.          return;
  1185.  
  1186.       case NERR_CallingRplSrvr:
  1187.    
  1188.          error_message = "Connecting to the Remoteboot server...";
  1189.          return;
  1190.  
  1191.       case NERR_StartingRplBoot:
  1192.    
  1193.          error_message = "Connecting to the Remoteboot server...";
  1194.          return;
  1195.  
  1196.       case NERR_RplBootServiceTerm:
  1197.    
  1198.          error_message = "Remote boot service was stopped; check the error log for the cause of the problem.";
  1199.          return;
  1200.  
  1201.       case NERR_RplBootStartFailed:
  1202.    
  1203.          error_message = "Remote boot startup failed; check the error log for the cause of the problem.";
  1204.          return;
  1205.  
  1206.       case NERR_RPL_CONNECTED:
  1207.    
  1208.          error_message = "A second connection to a Remoteboot resource is not allowed.";
  1209.          return;
  1210.  
  1211.       case NERR_BrowserConfiguredToNotRun:
  1212.    
  1213.          error_message = "The browser service was configured with MaintainServerList=No.";
  1214.          return;
  1215.  
  1216.       case NERR_RplNoAdaptersStarted:
  1217.    
  1218.          error_message = "Service failed to start since none of the network adapters started with this service.";
  1219.          return;
  1220.  
  1221.       case NERR_RplBadRegistry:
  1222.    
  1223.          error_message = "Service failed to start due to bad startup information in the registry.";
  1224.          return;
  1225.  
  1226.       case NERR_RplBadDatabase:
  1227.    
  1228.          error_message = "Service failed to start because its database is absent or corrupt.";
  1229.          return;
  1230.  
  1231.       case NERR_RplRplfilesShare:
  1232.    
  1233.          error_message = "Service failed to start because RPLFILES share is absent.";
  1234.          return;
  1235.  
  1236.       case NERR_RplNotRplServer:
  1237.    
  1238.          error_message = "Service failed to start because RPLUSER group is absent.";
  1239.          return;
  1240.  
  1241.       case NERR_RplCannotEnum:
  1242.    
  1243.          error_message = "Cannot enumerate service records.";
  1244.          return;
  1245.  
  1246.       case NERR_RplWkstaInfoCorrupted:
  1247.    
  1248.          error_message = "Workstation record information has been corrupted.";
  1249.          return;
  1250.  
  1251.       case NERR_RplWkstaNotFound:
  1252.    
  1253.          error_message = "Workstation record was not found.";
  1254.          return;
  1255.  
  1256.       case NERR_RplWkstaNameUnavailable:
  1257.    
  1258.          error_message = "Workstation name is in use by some other workstation.";
  1259.          return;
  1260.  
  1261.       case NERR_RplProfileInfoCorrupted:
  1262.    
  1263.          error_message = "Profile record information has been corrupted.";
  1264.          return;
  1265.  
  1266.       case NERR_RplProfileNotFound:
  1267.    
  1268.          error_message = "Profile record was not found.";
  1269.          return;
  1270.  
  1271.       case NERR_RplProfileNameUnavailable:
  1272.    
  1273.          error_message = "Profile name is in use by some other profile.";
  1274.          return;
  1275.  
  1276.       case NERR_RplProfileNotEmpty:
  1277.    
  1278.          error_message = "There are workstations using this profile.";
  1279.          return;
  1280.  
  1281.       case NERR_RplConfigInfoCorrupted:
  1282.    
  1283.          error_message = "Configuration record information has been corrupted.";
  1284.          return;
  1285.  
  1286.       case NERR_RplConfigNotFound:
  1287.    
  1288.          error_message = "Configuration record was not found.";
  1289.          return;
  1290.  
  1291.       case NERR_RplAdapterInfoCorrupted:
  1292.    
  1293.          error_message = "Adapter id record information has been corrupted.";
  1294.          return;
  1295.  
  1296.       case NERR_RplInternal:
  1297.    
  1298.          error_message = "An internal service error has occured.";
  1299.          return;
  1300.  
  1301.       case NERR_RplVendorInfoCorrupted:
  1302.    
  1303.          error_message = "Vendor id record information has been corrupted.";
  1304.          return;
  1305.  
  1306.       case NERR_RplBootInfoCorrupted:
  1307.    
  1308.          error_message = "Boot block record information has been corrupted.";
  1309.          return;
  1310.  
  1311.       case NERR_RplWkstaNeedsUserAcct:
  1312.    
  1313.          error_message = "The user account for this workstation record is missing.";
  1314.          return;
  1315.  
  1316.       case NERR_RplNeedsRPLUSERAcct:
  1317.    
  1318.          error_message = "The RPLUSER local group could not be found.";
  1319.          return;
  1320.  
  1321.       case NERR_RplBootNotFound:
  1322.    
  1323.          error_message = "Boot block record was not found.";
  1324.          return;
  1325.  
  1326.       case NERR_RplIncompatibleProfile:
  1327.    
  1328.          error_message = "Chosen profile is incompatible with this workstation.";
  1329.          return;
  1330.  
  1331.       case NERR_RplAdapterNameUnavailable:
  1332.    
  1333.          error_message = "Chosen network adapter id is in use by some other workstation.";
  1334.          return;
  1335.  
  1336.       case NERR_RplConfigNotEmpty:
  1337.    
  1338.          error_message = "There are profiles using this configuration.";
  1339.          return;
  1340.  
  1341.       case NERR_RplBootInUse:
  1342.    
  1343.          error_message = "There are workstations, profiles or configurations using this boot block.";
  1344.          return;
  1345.  
  1346.       case NERR_RplBackupDatabase:
  1347.    
  1348.          error_message = "Service failed to backup remoteboot database.";
  1349.          return;
  1350.  
  1351.       case NERR_RplAdapterNotFound:
  1352.    
  1353.          error_message = "Adapter record was not found.";
  1354.          return;
  1355.  
  1356.       case NERR_RplVendorNotFound:
  1357.    
  1358.          error_message = "Vendor record was not found.";
  1359.          return;
  1360.  
  1361.       case NERR_RplVendorNameUnavailable:
  1362.    
  1363.          error_message = "Vendor name is in use by some other vendor record.";
  1364.          return;
  1365.  
  1366.       case NERR_RplBootNameUnavailable:
  1367.    
  1368.          error_message = "(boot name, vendor id) is in use by some other boot block record.";
  1369.          return;
  1370.  
  1371.       case NERR_RplConfigNameUnavailable:
  1372.    
  1373.          error_message = "Configuration name is in use by some other configuration.";
  1374.          return;
  1375.  
  1376.       default:
  1377.  
  1378.          if ( error_code < NERR_BASE )
  1379.          {
  1380.             /*
  1381.             ** This ain't a LanMan error code, let's see if it'll Format...
  1382.             */
  1383.  
  1384.             LPVOID message_buffer = (LPVOID) NULL;
  1385.  
  1386.             FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
  1387.                            NULL,
  1388.                            error_code,
  1389.                            MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ),
  1390.                  (LPTSTR) &message_buffer,
  1391.                            0,
  1392.                            NULL );
  1393.  
  1394.             if ( message_buffer != NULL )
  1395.             {
  1396.                TCHAR temp_string[ 255 ];
  1397.  
  1398.                wsprintf( temp_string, "Not an NERR but it means %s", (LPCTSTR) message_buffer );
  1399.  
  1400.                LocalFree( message_buffer );
  1401.  
  1402.                error_message = temp_string;
  1403.             }
  1404.             else
  1405.             {
  1406.                TCHAR temp_string[ 256 ];
  1407.  
  1408.                wsprintf( temp_string, "Not an NERR, code is %d", error_code );
  1409.                error_message = temp_string;
  1410.             }
  1411.          }
  1412.          else
  1413.          {
  1414.             TCHAR temp_string[ 256 ];
  1415.  
  1416.             wsprintf( temp_string, "Unknown error %d (NERR_BASE+%d)", error_code, error_code - NERR_BASE );
  1417.             error_message = temp_string;
  1418.          }
  1419.  
  1420.          return;
  1421.    }
  1422. }
  1423.